﻿<UserControl x:Class="BestCode.Creds.UI.VwEntities"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:controls="clr-namespace:BestCode.Wpf.Controls;assembly=BestCode.Wpf.Controls"
             xmlns:data="clr-namespace:BestCode.Wpf.Controls.Data;assembly=BestCode.Wpf.Controls.Data"
             mc:Ignorable="d" 
             MinHeight="500" MinWidth="579">
    <Grid>
        <controls:FormHeader TitleText="ENTITIES" DescriptionText="Edit Entity form" Margin="0">
            <Grid>
                <data:Navigator Height="303" VerticalAlignment="Top" VisibilityButtonFind="Collapsed">
                    <Grid Margin="0,0,0,0" Height="300">

                        <TextBlock Text="Code :" Margin="35,36,494,0" Height="21" VerticalAlignment="Top"/>
                        <TextBlock Text="Name :" Margin="192,36,0,0" Height="22" VerticalAlignment="Top" HorizontalAlignment="Left" Width="48"/>
                        <TextBlock Text="Description :" Margin="10,74,489,0" Height="20" VerticalAlignment="Top"/>
                        <TextBlock Text="Anverse T. :" Margin="15,142,0,0" Height="25" VerticalAlignment="Top" HorizontalAlignment="Left" Width="70"/>
                        <TextBlock Text="Reverse T. :" Margin="15,172,0,0" Height="23" VerticalAlignment="Top" HorizontalAlignment="Left" Width="70"/>
                        <TextBox Height="22" Text="{Binding SelectedItem.Code, Mode=TwoWay}" HorizontalAlignment="Left" Margin="90,35,0,0" VerticalAlignment="Top" Width="93" FontSize="14" FontWeight="Bold" />
                        <TextBox Height="23" Margin="240,35,10,0"  Text="{Binding SelectedItem.Name, Mode=TwoWay}" VerticalAlignment="Top" />
                        <TextBox Height="40" Margin="90,65,78,0"  Text="{Binding SelectedItem.Description, Mode=TwoWay}" VerticalAlignment="Top" TextWrapping="Wrap" />
                        <ComboBox Margin="90,136,0,0" FontSize="14" FontWeight="Bold" Height="31" VerticalAlignment="Top"  ItemsSource="{Binding VmTemplateAnverse.Items, Mode=TwoWay}" SelectedItem="{Binding SelectedItem.AnverseFace, Mode=TwoWay}" HorizontalAlignment="Left" Width="231" />
                        <ComboBox Margin="90,172,0,0" FontSize="14" FontWeight="Bold" ItemsSource="{Binding VmTemplateReverse.Items, Mode=TwoWay}" SelectedItem="{Binding SelectedItem.ReverseFace, Mode=TwoWay}" Height="31" VerticalAlignment="Top" HorizontalAlignment="Left" Width="231" IsSynchronizedWithCurrentItem="True" />
                        <TextBlock Text="Pictures From :" Margin="15,240,0,0" Height="23" VerticalAlignment="Top" HorizontalAlignment="Left" Width="85"/>
                        <TextBox Height="22" Text="{Binding SelectedItem.PicturesFolder, Mode=TwoWay}" Margin="116,240,59,0" VerticalAlignment="Top" FontSize="14" FontWeight="Bold" />
                        <Button Margin="0,239,19,0" Content="......" Click="Button_Click" Height="23" VerticalAlignment="Top" HorizontalAlignment="Right" Width="35" />
                        <TextBlock Text="Pictures Configuration :" Margin="12,212,0,0" Height="23" VerticalAlignment="Top" FontWeight="Bold" FontSize="14" HorizontalAlignment="Left" Width="156"/>
                        <TextBlock Text="Basic Information :" Margin="10,10,0,0" Height="23" VerticalAlignment="Top" FontWeight="Bold" FontSize="14" HorizontalAlignment="Left" Width="156"/>
                        <TextBlock Text="Template :" Margin="10,113,0,0" Height="23" VerticalAlignment="Top" FontWeight="Bold" FontSize="14" HorizontalAlignment="Left" Width="156"/>
                        <TextBox Height="23" Margin="0,65,10,0"  Text="{Binding SelectedItem.CredentialCost, Mode=TwoWay}" VerticalAlignment="Top" HorizontalAlignment="Right" Width="63" />

                    </Grid>
                </data:Navigator>

                <DataGrid AutoGenerateColumns="False" ItemsSource="{Binding Items,Mode=TwoWay}" 
                  SelectedItem="{Binding SelectedItem,Mode=TwoWay}" Margin="6,308,6,23" IsReadOnly="True">

                    <DataGrid.Columns>
                        <DataGridTextColumn Header="Code" Binding="{Binding Code}"/>
                        <DataGridTextColumn Header="Name" Binding="{Binding Name}"/>
                        <DataGridTextColumn Header="Anverse Template" Binding="{Binding AnverseFace}"/>
                        <DataGridTextColumn Header="Reverse Template" Binding="{Binding ReverseFace}"/>
                        <DataGridTemplateColumn Width="*" Header="Load Persons">
                            <DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <Grid>
                                        <Button Name="btnPersons" Click="btnPersons_OnClick">Load Persons</Button>
                                    </Grid>
                                </DataTemplate>
                            </DataGridTemplateColumn.CellTemplate>
                        </DataGridTemplateColumn>
                        <DataGridTemplateColumn Width="*" Header="Children">
                            <DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <Grid>
                                        <Button Name="btnChildrenEntities" Click="BtnChildrenEntities_OnClick">Children Entities</Button>
                                    </Grid>
                                </DataTemplate>
                            </DataGridTemplateColumn.CellTemplate>
                        </DataGridTemplateColumn>

                    </DataGrid.Columns>

                </DataGrid>
            </Grid>

        </controls:FormHeader>
    </Grid>
</UserControl>
